package com.fkframe.codegener.ui;

import java.awt.Dimension;

import javax.swing.JButton;
import javax.swing.JPanel;
//===========================================
//软件主窗体 ExamServer.java
//===========================================
public class ExamServer
{
	public static void main(String[] args) 
	{ 
		//创建新实例
		EETSoftFrame frame = new EETSoftFrame("");//创建新窗体
		setMenu(frame);//初始化菜单
		setLoginPanel(frame) ; //登陆面板
		frame.validate();
	}
	//============================
	//添加菜单
	//============================
	private static void setMenu(EETSoftFrame frame)
	{
		//====================================================================
		//getMenuButton(a,b,c,d)参数:a:菜单图片,b:鼠标经过图片,c:提示文字,d:是否主菜单
		//====================================================================
		//=====================================
		// 
		//=====================================
		/*JButton btn_stu;
		JButton btn_stu_search,btn_stu_add,btn_stu_list,btn_stu_class,btn_stu_classlist;
		btn_stu = frame.getMenuButton("btn_stu.png", "btn_stu_on.png", "考生管理","mainmenu");
		frame.setMainMenu(btn_stu);
		//查询
		btn_stu_search = frame.getMenuButton("btn_stu_search.png", "btn_stu_search_on.png", "考生查询","submenu");;
		frame.addSubMenu(btn_stu, btn_stu_search, "btn_stu_search");
		//添加
		btn_stu_add = frame.getMenuButton("btn_stu_add.png", "btn_stu_add_on.png", "添加考生","submenu");;
		frame.addSubMenu(btn_stu, btn_stu_add, "btn_stu_add");
		//列表
		btn_stu_list = frame.getMenuButton("btn_stu_list.png", "btn_stu_list_on.png", "查询考生","submenu");;
		frame.addSubMenu(btn_stu, btn_stu_list, "btn_stu_list");
		//班级
		btn_stu_class = frame.getMenuButton("btn_stu_class.png", "btn_stu_class_on.png", "班级设置","submenu");;
		frame.addSubMenu(btn_stu, btn_stu_class, "btn_stu_class");
		//查询
		btn_stu_classlist = frame.getMenuButton("btn_stu_classlist.png", "btn_stu_classlist_on.png", "班级列表","submenu");;
		frame.addSubMenu(btn_stu, btn_stu_classlist, "btn_stu_classlist");*/
		
		//=====================================
		// 试题管理菜单
		//=====================================
		/*JButton btn_exam; //主菜单
		JButton btn_exam_kind , btn_exam_add , btn_exam_list;//btn_exam_getexam , 
		btn_exam = frame.getMenuButton("btn_exam.png", "btn_exam_on.png", "试题管理","mainmenu");
		frame.setMainMenu(btn_exam);
		//题库服务器读取试题
		btn_exam_getexam  = frame.getMenuButton("btn_exam_getexam.png", "btn_exam_getexam_on.png", "领取试题","submenu");;
		frame.addSubMenu(btn_exam, btn_exam_getexam, "btn_exam_getexam");
		//试题分类
		btn_exam_kind = frame.getMenuButton("btn_exam_kind.png", "btn_exam_kind_on.png", "试题分类","submenu");;
		frame.addSubMenu(btn_exam, btn_exam_kind, "btn_exam_kind");
		//试题添加
		btn_exam_add = frame.getMenuButton("btn_exam_add.png", "btn_exam_add_on.png", "试题添加","submenu");;
		frame.addSubMenu(btn_exam, btn_exam_add, "btn_exam_add");
		//试题分类
		btn_exam_list = frame.getMenuButton("btn_exam_list.png", "btn_exam_list_on.png", "试题列表","submenu");;
		frame.addSubMenu(btn_exam, btn_exam_list, "btn_exam_list");
		*/
		//=====================================
		// 试卷管理信息
		//=====================================
		/*JButton btn_paper;
		JButton btn_paper_design , btn_paper_send , btn_paper_received;
		btn_paper = frame.getMenuButton("btn_paper.png", "btn_paper_on.png", "试卷管理","mainmenu");
		frame.setMainMenu(btn_paper);
		//发放试卷
		btn_paper_send = frame.getMenuButton("btn_paper_send.png", "btn_paper_send_on.png", "发放试卷","submenu");
		frame.addSubMenu(btn_paper, btn_paper_send, "btn_paper_send");
		//试卷设置
		btn_paper_design = frame.getMenuButton("btn_paper_design.png", "btn_paper_design_on.png", "试卷设置","submenu");
		frame.addSubMenu(btn_paper, btn_paper_design, "btn_paper_design");
		//已交试卷
		btn_paper_received = frame.getMenuButton("btn_paper_received.png", "btn_paper_received_on.png", "已交试卷","submenu");
		frame.addSubMenu(btn_paper, btn_paper_received, "btn_paper_received");*/
		
		//=====================================
		// 考场管理
		//=====================================
/*		JButton btn_room;
		JButton btn_room_add,btn_room_list ;
		btn_room = frame.getMenuButton("btn_room.png", "btn_room_on.png", "考场管理","mainmenu");
		frame.setMainMenu(btn_room);
		//添加考场
		btn_room_add = frame.getMenuButton("btn_room_add.png", "btn_room_add_on.png", "添加考场","submenu");;
		frame.addSubMenu(btn_room, btn_room_add, "btn_room_add");
		//考场列表
		btn_room_list = frame.getMenuButton("btn_room_list.png", "btn_room_list_on.png", "考场列表","submenu");;
		frame.addSubMenu(btn_room, btn_room_list, "btn_room_list");*/
		//=====================================
		// 学科管理
		//=====================================
		/*JButton btn_subject ; 
		JButton btn_subject_add , btn_subject_list;
		btn_subject = frame.getMenuButton("btn_subject.png", "btn_subject_on.png", "学科管理","mainmenu");
		frame.setMainMenu(btn_subject);
		//添加学科
		btn_subject_add = frame.getMenuButton("btn_subject_add.png", "btn_subject_add_on.png", "添加学科","submenu");
		frame.addSubMenu(btn_subject, btn_subject_add, "btn_subject_add");
		//学科列表
		btn_subject_list = frame.getMenuButton("btn_subject_list.png", "btn_subject_list_on.png", "学科列表","submenu");
		frame.addSubMenu(btn_subject, btn_subject_list, "btn_subject_list");
		*/
		//=====================================
		// 单表
		//=====================================
		/*JButton btn_paperscore ; 
		JButton btn_paperscore_search , btn_paperscore_t;
		btn_paperscore = frame.getMenuButton("btn_paperscore.png", "btn_paperscore_on.png", "成绩管理","mainmenu");
		frame.setMainMenu(btn_paperscore);
		//成绩查询
		btn_paperscore_search = frame.getMenuButton("btn_paperscore_search.png", "btn_paperscore_search_on.png", "成绩查询","submenu");;
		frame.addSubMenu(btn_paperscore, btn_paperscore_search, "btn_paperscore_search");
		//成绩统计
		btn_paperscore_t = frame.getMenuButton("btn_paperscore_t.png", "btn_paperscore_t_on.png", "成绩统计","submenu");;
		frame.addSubMenu(btn_paperscore, btn_paperscore_t, "btn_paperscore_t");*/
		
		//=====================================
		// 0.系统参数
		//=====================================
		JButton moudleSys = frame.getMenuButton("系统参数");
		//frame.setMainMenu(moudleSys);
		//基本参数
		JButton btn_dbseting = frame.getMenuButton("数据库设置");
		//frame.addSubMenu(moudleSys, btn_dbseting, "btn_exam_kind");
		//=====================================
		
		//=====================================
		// 1 基本生成
		//=====================================
		JButton moduleBase = frame.getMenuButton("代码生成");
		frame.setMainMenu(moduleBase);
		//实体生成
		JButton btn_entity_genner = frame.getMenuButton("实体&基本生成");
		frame.addSubMenu(moduleBase, btn_entity_genner, "btn_entity_genner");
		
		//单表生成
		JButton btn_single_genner = frame.getMenuButton("单表生成");
		frame.addSubMenu(moduleBase, btn_single_genner, "btn_single_genner");
		
		//多表生成
		JButton btn_two_genner = frame.getMenuButton("多表生成");
		frame.addSubMenu(moduleBase, btn_two_genner, "btn_two_genner");
		
		//设置默认菜单,也就是左边在软件运行时直接显示什么
		frame.setDefaultMenu(moduleBase);
	}
	//====================================
	// 右边主要面板
	//====================================
	protected static void setLoginPanel(EETSoftFrame frame){
		JPanel panel = frame.panel.m_panel.p_right; 
		JPanel l = new JPanel();
		l.setPreferredSize(new Dimension(panel.getWidth(),panel.getHeight()));
		//l.setBackground(Color.pink);
		panel.add(l);
	}
}